package com.um.jdy.platform.market.controller;

import com.um.jdy.common.market.entity.dto.ActivityGoodsDTO;
import com.um.jdy.common.market.entity.po.ActivityGoods;
import com.um.jdy.common.market.entity.vo.ActivityGoodsVO;
import com.um.jdy.common.market.service.ActivityGoodsService;
import com.um.jdy.platform.market.entity.dto.ActivityGoodsPageDTO;
import com.um.jdy.platform.market.entity.dto.ActivityPageDTO;
import com.um.jdy.platform.market.manager.ActivityGoodsManager;
import com.um.jdy.platform.shop.entity.dto.GoodsPageDTO;
import com.um.jdy.platform.shop.entity.vo.GoodsPageVO;
import com.um.springboot.starter.annotation.ApiPermission;
import com.um.springboot.starter.annotation.TokenRequired;
import com.um.springboot.starter.entity.Page;
import com.um.springboot.starter.orm.controller.BaseController;
import com.um.springboot.starter.orm.controller.BasePlusController;
import com.um.springboot.starter.orm.entity.Response;
import com.um.springboot.starter.orm.params.ListDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * 控制器：活动商品表
 */
@RestController
@RequestMapping("/api/v1/market/activity_goods")
@Api(tags = "ActivityGoodsController", description = "活动商品表")
@ApiPermission("activity_goods")
@TokenRequired
public class ActivityGoodsController extends BasePlusController<ActivityGoodsManager, ActivityGoodsService, ActivityGoods, ActivityGoodsDTO, ActivityGoodsVO, ActivityGoodsPageDTO, ListDTO> {

    @ApiPermission("page")
    @ApiOperation("分页查询活动商品")
    @PostMapping("get_activity_goods_page")
    public Response<Page<GoodsPageVO>> getActivityGoodsPage(@RequestBody ActivityGoodsPageDTO pageDTO) {
        return Response.success(manager.getActivityGoodsPage(pageDTO));
    }

}
